import {request} from '../../utils/http'

Page({
  data: {
    couponId:null,
    coupon_received_id:null,
    info:{}
  },
  onLoad(query:any) {
    this.setData({
      couponId:query.coupon_id,
      coupon_received_id:query.id
    }, () => {
      this.getInfo()
    })
  },
  getInfo(){
    request(`/coupon/${this.data.couponId}`,'get', {
      coupon_received_id:this.data.coupon_received_id
    }).then(res => {
      console.log(res)
      if (res.code == 200) {
        this.setData({
          info:res.data
        })
      }
    })
  },
});
